<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class subject_live_model extends model {
	public function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'subject_live';
		parent::__construct();
	}

	/**
	 * 添加修改直播主题
	 */
	public function edit ($data,$id='')
	{
		if (!$id) {
			$id = $this->insert($data, true);
		} else {
			$ids = $this->update($data, array('id'=>$id));
		}
		return $id;
	}

	/**
	 * 取直播列表
	 */
	public function getGameList ()
	{
		$where = array();
		$where['status'] = 1;
		$list = $this->select($where);
		$data = array();
		foreach ($list as $v) {
			$data[$v['id']] = $v['name'];
		}
		return $data;
	}
}
?>
